﻿package com.janisRadins.asDraw {
	import flash.events.Event;
	/**
	 * @author Jānis Radiņš
	 */
	public class CurveChangeEvent extends Event {
		public static const CHANGE:String = "change";
		
		public static const CONTROL_X:String = "controlX";
		public static const CONTROL_y:String = "controlY";
		public static const ANCHOR_X:String = "anchorX";
		public static const ANCHOR_Y:String = "anchorY";
		/** @private */
		protected var _property:String = null;
		/** @private */
		protected var _oldValue:Number = NaN;
		/** @private */
		protected var _newValue:Number = NaN;
		
		public function CurveChangeEvent(type:String, property:String, oldValue:Number, newValue:Number) {
			super(type, false, true);
			_property = property;
			_oldValue = oldValue;
			_newValue = newValue;
		}
		
		public function get property():String {
			return _property;
		}
		public function get oldValue():Number {
			return _oldValue;
		}
		public function get newValue():Number {
			return _newValue;
		}
		override public function clone():Event {
			return new CurveChangeEvent(type, _property, _oldValue, _newValue);
		}
		override public function toString():String {
			return formatToString("CurveChangeEvent",  "property", "oldValue", "newValue");
		}
	}
	
}